<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="databinding"></div>
  <div id="mixins-basic"></div>
  <script>
    var vm = new Vue({
      el: '#databinding',
      data: {
      },
      methods: {
      },
    });
    // 定义一个混入对象
    var myMixin = {
      created: function () {
        this.startmixin()
      },
      methods: {
        startmixin: function () {
          document.write("欢迎来到混入实例");
        }
      }
    };
    var Component = Vue.extend({
      mixins: [myMixin]
    })
    var component = new Component();
    var mixin = {
        created: function () {
            document.write('混入调用' + '<br>')
        }
    }
    new Vue({
        mixins: [mixin],
            created: function () {
            document.write('组件调用' + '<br>')
        }
    });


    // 
    
  </script>
</body>

</html>